#include<cstdio>
bool add(char c)
{
	if (c==')')
	{
		if (top>=2 && stk[top-1]='(' && stk[top]=='A') top-=2,add('A');
		else if (top>=3 && stk[top-2]=='(' && stk[top-1]=='A' && stk[top]=='S') top-=3,add('A');
		else if (top>=3 && stk[top-2]=='(' && stk[top-1]=='S' && stk[top]=='A') top-=3,add('A');
		else return 0;
	}
	if (c=='A')
	{
		if (top>=1 && stk[top-1]=='A') top-=1,add('A');
		else if (top>=2 && stk[top-2]=='A' && stk[top-1]=='S') top-=2,add('A');
		else stk[++top]='A';
	}
}
void dfs(int x,int t)
{
	if (x>n) return (void)(++ans);
	if (S[x]=='*' || S[x]=='?')
	{
		if (t<k)
		{
			if (stk[top]!='S')
			{
				stk[++top]='S';
				dfs(x+1,t);
				--top;
			}
			else dfs(x+1,t);
		}
	}
	if (S[x]=='(' || S[x]=='?')
	{
		stk[++top]=')';
		dfs(x+1,0);
	}
	if (S[x]==')' || S[x]=='?')
	{
		char tmp[N];
		memcpy();
		tmptop=top;
		if (top>=2 && stk[top-1]='(' && stk[top]=='A')top-=2;
		else if (top>=3 && stk[top-2]=='(' && stk[top-1]=='A' && stk[top]=='S') top-=3;
		else if (top>=3 && stk[top-2]=='(' && stk[top-1]=='S' && stk[top]=='A') top-=3;
		dfs(x+1,0);
		top=tmptop;
		
	}
}
int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%d%d%s",&n,&k,S+1);
	return 0;
}
